<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html><head>
        <link rel="stylesheet" type="text/css" href="apidocs.css"/>
        <title>API docs for &ldquo;sympy.geometry.util&rdquo;</title>
        </head>
        <body><h1 class="module">Module s.g.util</h1><span id="part">Part of <a href="sympy.geometry.html">sympy.geometry</a></span><div class="toplevel"><div class="undocumented">Undocumented</div></div><table class="children"><tr class="function"><td>Function</td><td><a href="#sympy.geometry.util.intersection">intersection</a></td><td><div><p>Finds the intersection between a list GeometryEntity instances. Returns 
a</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.geometry.util.convex_hull">convex_hull</a></td><td><div><p>Returns a Polygon representing the convex hull of a set of 2D 
points.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.geometry.util.are_similar">are_similar</a></td><td><div><p>Returns True if e1 and e2 are similar (one can be uniformly scaled 
to</p>
</div></td></tr></table>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.util.intersection">intersection(*entities):</a></div>
            <div class="functionBody"><div><p>Finds the intersection between a list GeometryEntity instances. Returns 
a list of all the intersections, Will raise a NotImplementedError exception
if unable to calculate the intersection.</p>
<h1 class="heading">Examples:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">from</span> sympy.geometry <span class="py-keyword">import</span> *
<span class="py-prompt">&gt;&gt;&gt; </span>p1,p2,p3 = Point(0,0), Point(1,1), Point(-1, 5)
<span class="py-prompt">&gt;&gt;&gt; </span>l1, l2 = Line(p1, p2), Line(p3, p2)
<span class="py-prompt">&gt;&gt;&gt; </span>c = Circle(p2, 1)
<span class="py-prompt">&gt;&gt;&gt; </span>intersection(l1, p2)
<span class="py-output">[Point(1, 1)]</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>intersection(l1, l2)
<span class="py-output">[Point(1, 1)]</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>intersection(c, p2)
<span class="py-output">[]</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>intersection(c, Point(1, 0))
<span class="py-output">[Point(1, 0)]</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>intersection(c, l2)
<span class="py-output">[Point(1 - 1/5*5**(1/2), 1 + (2/5)*5**(1/2)), Point(1 + (1/5)*5**(1/2), 1 - 2/5*5**(1/2))]</span></pre>
<h1 class="heading">Notes:</h1>
  <ul>
    <li>
      The intersection of any geometrical entity with itself should return 
      a list with one item: the entity in question.
    </li>
    <li>
      An intersection requires two or more entities. If only a single 
      entity is given then one will receive an empty intersection list.
    </li>
    <li>
      It is possible for intersection() to miss intersections that one 
      knows exists because the required quantities were not fully 
      simplified internally.
    </li>
  </ul>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.util.convex_hull">convex_hull(*args):</a></div>
            <div class="functionBody"><div><p>Returns a Polygon representing the convex hull of a set of 2D 
points.</p>
<h1 class="heading">Notes:</h1>
  <p>This can only be performed on a set of non-symbolic points.</p>
<h1 class="heading">Example:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">from</span> sympy.geometry <span class="py-keyword">import</span> Point
<span class="py-prompt">&gt;&gt;&gt; </span>points = [ Point(x) <span class="py-keyword">for</span> x <span class="py-keyword">in</span> [(1,1), (1,2), (3,1), (-5,2), (15,4)] ]
<span class="py-prompt">&gt;&gt;&gt; </span>convex_hull(points)
<span class="py-output">Polygon(Point(3, 1), Point(15, 4), Point(-5, 2), Point(1, 1))</span></pre>
<h1 class="heading">Description of method used:</h1>
  <p>See http://en.wikipedia.org/wiki/Graham_scan.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.util.are_similar">are_similar(e1, e2):</a></div>
            <div class="functionBody"><div><p>Returns True if e1 and e2 are similar (one can be uniformly scaled to 
the other) or False otherwise.</p>
<h1 class="heading">Notes:</h1>
  <ul>
    <li>
      If the two objects are equal then they are always similar.
    </li>
  </ul>
</div></div>
            </div></body>
        